﻿<html>
<body>


<SCRIPT LANGUAGE="javascript">
    function OnSelectAllClieck()
    {
	var All = document.getElementById("selectall");
	
	var ItemList = document.getElementsByName("selectitem");
	for(i=0; i< ItemList.length; i++)
	{
		ItemList[i].checked = All.checked;
	}
    }

    function OnDeleteMessage()
    {
	var ItemList = document.getElementsByName("selectitem");
	for(i=0; i< ItemList.length; i++)
	{
		if(ItemList[i].checked)
		{
			return true;
		}
	}

	alert("请先选择希望删除的消息！");
	return false;
    }

</SCRIPT>

{% ifequal TagBox 'receive' %}
<p>收件箱</p>
{% endifequal %}

{% ifequal TagBox 'sendout' %}
<p>发件箱</p>
{% endifequal %}

{% ifequal TagBox 'delete' %}
<p>已删除消息</p>
{% endifequal %}


<form id="form_message_delete" onsubmit="return OnDeleteMessage()" action="/message_delete?tagbox={{ TagBox }}" method="post">

<table borderColor=#cccccc cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff border=1>
{% ifequal TagBox 'receive' %}
    <tr>
	<td width="20"  align="center">
		<input type="checkbox" name="selectall" id="selectall" onclick="OnSelectAllClieck()"></input>
	</td>

	<td align="left">
		发件人
	</td>

	<td align="left">
		标题
	</td>

	<td align="left">
		发送时间
	</td>
    </tr>

    {% for Item in Messages %}
      <tr>
	<td><input type="checkbox" name="selectitem" value="{{ Item.key }}"></td>
	
	{% ifequal Item.State 0 %}
		<Font color==#888888>
	{% endifequal %}

	<td><a href="/message_show?tagbox=receiveitem&item={{ Item.key }}">
		{{ Item.From }}
	    </a>
	</td>
		
	<td><a href="/message_show?tagbox=receiveitem&item={{ Item.key }}">
		{{ Item.Title }}
	    </a>
	</td>

	<td>{{ Item.Date|date:" Y-m-j H:i:s" }}</td>

	{% ifequal Item.State 0 %}
		</Font>
	{% endifequal %}


      </tr>
    {% endfor %}

{% endifequal %}


{% ifequal TagBox 'sendout' %}
    <tr>
	<td width="20"  align="center">
		<input type="checkbox" name="selectall" id="selectall" onclick="OnSelectAllClieck()"></input>
	</td>

	<td align="left">
		收件人
	</td>

	<td align="left">
		标题
	</td>

	<td align="left">
		发送时间
	</td>
    </tr>

    {% for Item in Messages %}
      <tr>
	<td><input type="checkbox" name="selectitem" value="{{ Item.key }}"></td>

	<td><a href="/message_show?tagbox=sendoutitem&item={{ Item.key }}">
		{{ Item.SendTo.0 }}
	    </a>
	</td>
		
	<td><a href="/message_show?tagbox=sendoutitem&item={{ Item.key }}">
		{{ Item.Title }}
	    </a>
	</td>

	<td>{{ Item.Date|date:" Y-m-j H:i:s" }}</td>
      </tr>
    {% endfor %}

{% endifequal %}



{% ifequal TagBox 'delete' %}
    <tr>
	<td width="20"  align="center">
		<input type="checkbox" name="selectall" id="selectall" onclick="OnSelectAllClieck()"></input>
	</td>

	<td align="left">
		发件人
	</td>

	<td align="left">
		标题
	</td>

	<td align="left">
		发送时间
	</td>
    </tr>

    {% for Item in Messages %}
      <tr>
	<td><input type="checkbox" name="selectitem" value="{{ Item.key }}"></td>
	
	{% ifequal Item.State 0 %}
		<Font color==#888888>
	{% endifequal %}

	<td><a href="/message_show?tagbox=deleteitem&item={{ Item.key }}">
		{{ Item.From }}
	    </a>
	</td>
		
	<td><a href="/message_show?tagbox=deleteitem&item={{ Item.key }}">
		{{ Item.Title }}
	    </a>
	</td>

	<td>{{ Item.Date|date:" Y-m-j H:i:s" }}</td>

	{% ifequal Item.State 0 %}
		</Font>
	{% endifequal %}


      </tr>
    {% endfor %}

{% endifequal %}




</table>

	<p align="center"><input type="submit" value="删除"/></p>
</form>


</body>
</html>
